<?php

namespace app\edu\controller;


use app\admin\controller\Admin;
use app\edu\model\Major;
use app\edu\model\Clazz;

class Publiz extends Admin {

    public function listMajor($office_id) {
        $major_list = Major::where(['office_id' => $office_id, 'status' => 1])->field('name,title')->order('name')->select();
        return json($major_list->toArray());
    }

    public function listClazz($major_name) {
        $clazz_list = Clazz::where(['major_name' => $major_name, 'status' => 1])->field('name,title')->order('name')->select();
        return json($clazz_list->toArray());
    }

}